package test.library;

public class BookList {
    private Book[] books = new Book[1024];
    private int quantity;

    //构造方法:填入一些书测试
    public BookList(){
        books[0] = new Book("java从初学到精通","xxx","编程教学",50);
        books[1] = new Book("浪潮之巅","吴军","科技工业",50);
        books[2] = new Book("高等数学","xxx","教科书",50);
        books[3] = new Book("三体","刘慈欣","科幻",50);
        quantity = 4;
    }

    //getter()
    public Book getBook(int index) {
        return books[index];
    }

    public int getQuantity() {
        return quantity;
    }

    //setter()
    public void setBook(int index,Book book) {
        books[index] = book;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
}
